package com.wanwu.channel.common.vo;



import java.io.Serializable;

/**
 * @ClassName DubboGenericVo
 * @Description dubbo配置信息
 * @Author husheng
 * @Date 2019-12-30 14:34
 */

public class DubboGenericVo implements Serializable {

    private static final long serialVersionUID = -7478290629226911185L;

    //类名
    private String className;

    //方法名
    private String method;

    //组
    private String group = "*";

    //dubbo版本
    private String version = "1.0.0";

    //参数类型
    private String paramType;

    //超时时间
    private int timeout = 5000;

    //dubbo版本
    private String dubboVersion = "2.5.3";

    public void formatClassMethod(String serviceCode) {
        this.className = serviceCode.substring(0, serviceCode.lastIndexOf("."));
        this.method = serviceCode.substring(serviceCode.lastIndexOf(".") + 1);
        switch (serviceCode){
            case "com.wanwu.payment.facade.PayServerFacade.prepay":
                this.paramType = "com.wanwu.payment.facade.dto.req.PrepayReqDto";
                break;
            case "com.wanwu.payment.facade.PayServerFacade.payQuery":
                this.paramType = "com.wanwu.payment.facade.dto.req.PayQueryReqDto";
                break;
            case "com.wanwu.payment.facade.PayServerNotifyFacade.payResultNotify":
                this.paramType = "com.wanwu.payment.facade.dto.req.PayResultNotifyReqDto";
                break;
            default:
                break;
        }
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getParamType() {
        return paramType;
    }

    public void setParamType(String paramType) {
        this.paramType = paramType;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getDubboVersion() {
        return dubboVersion;
    }

    public void setDubboVersion(String dubboVersion) {
        this.dubboVersion = dubboVersion;
    }
}
